<html>
<head>
    <title>数字内置函数</title>
</head>
<body>

<#-- 绝对值 -->
<#assign x=-5>
x=${x?abs}

<#-- lower_abc -->
<#list 1..30 as n>${n?lower_abc} </#list>

<#-- upper_abc -->
<#list 1..30 as n>${n?upper_abc} </#list>

<#-- is_nan -->
<#if nan_val?is_nan>
    is_nan = true
<#else>
    is_nan = false
</#if>

<#-- c 将数字转换成字符串 -->
<#-- ${x3} 这种方式将应用本地化格式输出 -->
<#-- ${x3?c} 将数字转换成字符串，不进行格式化 -->
<#assign x3=120000>
${x3} ==> ${x3?c}

<#-- round, floor, ceiling -->
<#assign testlist=[0, 1, -1, 0.5, 1.5, -0.5, -1.5, 0.25, -0.25, 1.75, -1.75]>
<#list testlist as result>
    ${result} ?floor=${result?floor} ?ceiling=${result?ceiling} ?round=${result?round}
</#list>

</body>
</html>